<?php
$link = mysqli_connect("localhost","root","root","2113");
// 获取所有数据的长度；
$sql = "SELECT COUNT(*) AS c FROM news";

$res =  mysqli_query($link,$sql);
$one=  mysqli_fetch_assoc($res);
// print_r($one);
$total = $one['c'];
$perpage = 5;
$p = ceil($total/$perpage);
$arr['p'] = $p;
echo json_encode($arr);


?>